<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8"/>
    <title>Title</title>
</head>
<body>
    <div th:id="form" th:text="${formData}" style="display: none;"></div>
    <div id="return"></div>

    <script type="text/javascript">
        window.onload = function (){
            document.forms[0].submit();
        };

        const form = document.getElementById("form").innerText;
        document.getElementById("return").innerHTML = form;
    </script>
</body>
</html>